import { createRouter, createWebHistory,createWebHashHistory} from 'vue-router'
import AppHome from '@/views/AppHome/index.vue'
import AppCategory from '@/views/AppCategory/index.vue'
import AppCart from '@/views/AppCart/index.vue'
import AppMine from '@/views/AppMine/index.vue'
import AppNotFound from '@/views/AppNotFound/index.vue'

import AppFooter from '../views/AppFooter/index.vue'
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    { path: '/', name: 'main', redirect: '/home' },
    { path: '/home', name: 'home', components: { default: AppHome, footer: AppFooter } },
    { path: '/category', name: 'category', components: { default: AppCategory, footer: AppFooter } },
    { path: '/cart', name: 'cart', components: { default: AppCart, footer: AppFooter } },
    { path: '/mine', name: 'mine', components: { default: AppMine, footer: AppFooter } },
    { path: '/:pathMatch(.*)*', name: 'not-found', component: AppNotFound },
  ]
})

export default router
